package it.polimi.swKnights.SWIMv2.general;

public class WebsiteParameters
{
	public final static String homePageUrl = "SWIMv2-web/";	
	public final static String askAbilitiesUrl = "WEB-INF/users/ask-ability/AskAbility.jsp";
	public final static String  registeredUserHome = "userHome";
	public final static String registrationFormUrl = "WEB-INF/registration/RegistrationForm.jsp";
	public static final String seeAbilityRequestUrl = "WEB-INF/administration/SeeAbilityForm.jsp";
	public static final String deleteAccountFormUrl = "WEB-INF/users/delete-account/DeleteAccountForm.jsp";
	public static final String site = "https://localhost:8443/SWIMv2-web/";
	public static final String normalSearchFormUrl = "WEB-INF/search/NormalSearch.jsp";
	public static final String seeHelpRequestsFormUrl = "WEB-INF/help/seeHelpRequest.jsp";
	public static final int IMAGE_HEIGHT = 100;
	public static final int IMAGE_WIDTH = 100;
	
	public static final int FILE_MAX_SIZE = 1048576; //1MB
	
	
	public String switchToHttp(String url) 
	{
		url.replaceFirst("https", "https");
		url.replaceFirst(":8443",":8080" );
		return url;
	}
	
	
	public static enum StatusPage
	{
		badRequest, 
		not_complete_form,
		already_existent_ability, ability_requested;
	}
	
	public static String createImagePath(String imageName)
	{
		if(imageName == null)
			return "";
		if(imageName.equals(""))
			return imageName;
		
		StringBuilder builder = new StringBuilder();
		builder.append("profileImages/");
		builder.append(imageName);
		return builder.toString();
	}
	
	
	
	
}
